package com.priserve.retirement.mapper;

import java.util.ArrayList;
import java.util.List;

import com.priserve.retirement.VO.AdvisorVo;
import com.priserve.retirement.VO.ClientVo;
import com.priserve.retirement.entities.Advisor;
import com.priserve.retirement.entities.Clientinformation;

public class AdvisorMapper {


	public static List<ClientVo> mapClients(List<Clientinformation> clientinformatinList){
		
		List <ClientVo> clientList=new ArrayList<ClientVo>();
		for(Clientinformation clientInfo:clientinformatinList){
			clientList.add(mapClientObject(clientInfo));
		}
		
		return clientList;
	}
	
	
	public static ClientVo mapClientObject(Clientinformation clientInformation){
		
		ClientVo clientVo=new ClientVo();
		clientVo.setAddress(clientInformation.getClientAddress());
		clientVo.setClientId(clientInformation.getClientId());
		clientVo.setCountry(clientInformation.getClientCountry());
		clientVo.setDateOfBirth(clientInformation.getClientDob());
		clientVo.setEmail(clientInformation.getClientEmail());
		clientVo.setFirstName(clientInformation.getClientFirstName());
		clientVo.setGender(clientInformation.getClientGender());
		clientVo.setImage(clientInformation.getClientImage());
		clientVo.setLastName(clientInformation.getClientLastName());
		clientVo.setMiddleName(clientInformation.getClientMiddleName());
		clientVo.setNotes(clientInformation.getClientNotes());
		clientVo.setPhoneNumber(clientInformation.getClientPhoneNumber());
		clientVo.setStateOfResidence(clientInformation.getClientStateOfResidence());
		clientVo.setStatus(clientInformation.getClientStatus());
		clientVo.setTitle(clientInformation.getClientTitle());
		clientVo.setZipCode(clientInformation.getClientZipCode());
		clientVo.setAdvisorVo(mapAdvisorObject(clientInformation.getAdvisor()));
		
		return clientVo;
		
		
	}
	
	
	public static AdvisorVo mapAdvisorObject(Advisor advisor){
		
		AdvisorVo advisorVo=new AdvisorVo();
		advisorVo.setAdvisorId(advisor.getAdvisorId());
		advisorVo.setFirstName(advisor.getFirstName());
		advisorVo.setLastName(advisor.getLastName());
		advisorVo.setLoginId(advisor.getLoginId());
     
		return advisorVo;
	}
	
}
